<?php

namespace App\Models;

/**
 * Class HotWord
 * @property integer user_id 用户ID
 * @property boolean status 状态
 * @property integer sort 排序
 */
class HotWord extends ApplicationModel
{
    protected $fillable = [
        'user_id',
        'status',
        'sort',
    ];

    public function scopeRelease($query)
    {
        return $query->where('status', true)->orderBy('sort', 'desc');
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
